package com.yihu.wlyy.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 系统消息對象
 * @author George
 *
 */

@Entity
@Table(name = "wlyy_message")
public class Message extends IdEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -9034295139612066823L;
	
	// 消息标识
	private String code;
	// 消息接收人（微信平台为患者标识，医生APP平台为医生标识）
	private String receiver;
	private String receiverName;
	// 消息发送人标识
	private String sender;
	private String senderName;
	private String senderPhoto;
	// 群组标识\网络咨询标识\问卷随访标识
	private String data;
	// 消息标题
	private String title;
	// 消息内容
	private String content;
	// 消息类型（1.是家庭签约信息  2.体征消息 101患者申请取消签约、102患者同意取消签约、103患者拒绝取消签约、104患者填写了血糖记录、105患者填写了血压记录、106患者填写了体重记录、107患者填写了腰围记录、108患者填写了运动记录、109患者填写了用药记录、110患者填写了饮食记录、111患者提交了问卷随访、112请求添加好友消息、113入群消息、114群解散消息、115踢出群消息、116新的网络咨询、117网络咨询追问、201医生拒绝签约、202医生同意签约、203医生申请取消签约、204医生同意取消签约、205医生拒绝取消签约、206新的问卷随访、207新的健康干预、208请求添加好友消息、209入群消息、210群解散消息、211踢出群消息、212聊天消息提醒、213群聊天消息、214医生回复了网络咨询、215请求添加为家人）
	private Integer type;
	// 消息平台，1微信端/患者端，2医生APP端
	private Integer platform;
	// 消息状态，1已发送，0待发送，-1发送失败
	private Integer state;
	// 查看状态，1未读，0已读
	private Integer read;
	// 只读消息：1否，0是
	private Integer readonly;
	// 消息时间
	private Date czrq;
	// 是否作废，1正常，0作废
	private String del;

	private String signStatus;//签约状态 如果是签约 1新的签约，2签约成功，3签约失败，4解约申请，5解约成功，6解约失败，7签约到期

	private String reason;

	private String over;//是否操作结束 是否操作结束 1是 0否

	// 当前值/收缩压，正数为高，负数为低
	private Double value1;
	// 上次值/舒张压，正数为高，负数为低
	private Double value2;

	private String tzType;//体征类别

	private String tzCode;//体征code

	private Integer sex;//患者性别
	public Message() {

	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getPlatform() {
		return platform;
	}

	public void setPlatform(Integer platform) {
		this.platform = platform;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name="has_read")
	public Integer getRead() {
		return read;
	}

	public void setRead(Integer read) {
		this.read = read;
	}

	public Integer getReadonly() {
		return readonly;
	}

	public void setReadonly(Integer readonly) {
		this.readonly = readonly;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}

	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}

	public String getDel() {
		return del;
	}

	public void setDel(String del) {
		this.del = del;
	}

	@Column(name = "receiver_name", length = 200)
	public String getReceiverName() {
		return receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	@Column(name = "sender_name", length = 200)
	public String getSenderName() {
		return senderName;
	}

	public void setSenderName(String senderName) {
		this.senderName = senderName;
	}

	@Column(name = "sender_photo", length = 1000)
	public String getSenderPhoto() {
		return senderPhoto;
	}

	public void setSenderPhoto(String senderPhoto) {
		this.senderPhoto = senderPhoto;
	}

	@Column(name = "sign_status", length = 1000)
	public String getSignStatus() {
		return signStatus;
	}

	public void setSignStatus(String signStatus) {
		this.signStatus = signStatus;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getOver() {
		return over;
	}

	public void setOver(String over) {
		this.over = over;
	}

	public Double getValue1() {
		return value1;
	}

	public void setValue1(Double value1) {
		this.value1 = value1;
	}

	public Double getValue2() {
		return value2;
	}

	public void setValue2(Double value2) {
		this.value2 = value2;
	}

	@Column(name = "tz_type", length = 10)
	public String getTzType() {
		return tzType;
	}

	public void setTzType(String tzType) {
		this.tzType = tzType;
	}

	@Column(name = "tz_code", length = 100)
	public String getTzCode() {
		return tzCode;
	}

	public void setTzCode(String tzCode) {
		this.tzCode = tzCode;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}
}
